home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Exchange
/
CD Exchange - Volume 1.iso
/
graphics
/
utils
/
videotracker
/
develop
/
sourceaga
/
copperpicture.s
< prev
next >
Wrap
Text File
|
1994-01-11
|
48KB
|
2,259 lines
;rout ;when this is off, the routine-file will be
;assembled, on=testing
;debug ;when this is on, colors in the background will
;show how much time the routine needs.
;ntsctest ;when this is on, the routineplayer is in ntsc-mode
;ocs ;off=AGA,on=OCS testing not possible on OCS !
routinemode equ 1 ;the routinemode !
; VideoTracker AGA developer source 25-12-93
; 24-bits colors, Super-HiRes, HAM8, maximum burstmode (64 pixels aligned)
; wich makes low-resolution overscan a bit ugly.
; no "interactive" support anymore, it's only used by Kick 1.3 users.
; the first part of the source handles the things that are necessary to
; show the picture/copper and playing of the routine.
; the part between the "***" lines is the routine-source.
; at the bottom of the file, there are the necessary incbin-files who
; are needed to test the routine.
; these are saved with "save effect" in videotracker. they are raw
; data files which can be fonts,pictures,landscapes,vectorobjects
; etcetra.
; the incbin-files are put in the "variables" table, in the routine-
; player-handler
; the place where it's done can be found by searching for "!!!"
opt a+ ;devpac 3 optimize
opt o+
vew_wid equ 44
vew_hgt equ 290
win_hgt equ 117
win_str equ $1a
ifd ocs
pic_wid equ 4 ;wide in bytes
pic_hgt equ 6 ;hoogte
pic_dpt equ 8 ;number planes
pic_ani equ 10 ;aantal effes (anim)
pic_vew equ 12 ;viewmode
pic_cycstr equ 14 ;cycle start (*4)
pic_cycend equ 15 ;cycle end (*4)
pic_cycspd equ 16 ;cycle speed (*4)
pic_cycadd equ 17 ;cycle add (*4)
pic_palnum equ 30 ;aantal kleuren
pic_pal equ 32 ;palette start
pic_palsiz equ 256*2 ;vaste palette size
pic_raw equ pic_pal+pic_palsiz ;palette start
endc
ifnd ocs
pic_wid equ 4 ;wide in bytes
pic_hgt equ 6 ;hoogte
pic_dpt equ 8 ;number planes
pic_ani equ 10 ;aantal effes (anim)
pic_vew equ 12 ;viewmode
pic_cycstr equ 14 ;cycle start (*8)
pic_cycend equ 15 ;cycle end (*8)
pic_cycspd equ 16 ;cycle speed (*8)
pic_cycadd equ 17 ;cycle add (*8)
pic_widmod equ 46 ;animation-width modulo
pic_future equ 50 ;free future space
pic_palnum equ 62 ;aantal kleuren
pic_pal equ 64 ;palette start
pic_palsiz equ 256*4 ;vaste palette size (longwords)
pic_raw equ pic_pal+pic_palsiz ;palette start
endc
var_len equ $300 ;lengte vartabel
var__GfxBase equ $000 ;graphics lib
var_pic1 equ $004 ;current picture
var_anispd1 equ $008 ;animspeed
var_anitel1 equ $00c ;animcount
var_cprbck equ $010 ;copperback
var_bck equ $014 ;background
var_pic2 equ $018 ;current picture
var_ntsc equ $01c ;ntsc/pal frequence
var_lnd equ $020 ;landscape
var_anilop1 equ $024
var_rottrg equ $028 ;effect trigger
var_txt1 equ $040 ;text
var_txt16 equ 15*4+var_txt1
var_vec1 equ $080 ;vectors
var_vec16 equ 15*4+var_vec1
var_fon1 equ $0c0 ;fonts
var_fon16 equ 15*4+var_fon1
var_cols1 equ $100 ;colorsets
var_cols16 equ 15*4+var_cols1
var_obj1 equ $180 ;objects
var_obj16 equ 15*4+var_obj1
ifd rout
;videotracker routine-test
incdir "videotracker:include/"
include "exec/types.i"
include "graphics/gfxbase.i"
include "lvo/graphics_lib.i"
incdir 'videotracker:effect/'
SECTION 1,CODE_C
tus
lea var,a0
move.l #rotsrc,curpic1 ;picture !!!
move.l #rotsrc,curpal1 ;palette !!!
move.l #rotset,var_cols1(a0) ;colorset !!!
move.l ($4).w,a6
sub.l a1,a1
jsr -$126(a6) ;findtask
move.l d0,curtsk
move.l d0,a0
move.l $b8(a0),tskpri
lea dosnam,a1 ;doslib openen
moveq.l #0,d0
move.l (4).w,a6
jsr -408(a6) ;openlib
move.l d0,doslib
bsr.s label5 ;videotracker opstarten
move.l curtsk,a0
move.l tskpri,$b8(a0)
move.l ($4).w,a6
jsr -$84(a6) ;forbid
move.l doslib,a1
move.l (4).w,a6
jsr -414(a6) ;closelib
moveq.l #0,d0
rts
label5
move.l (4).w,a6 ;workbench gedoe
move.b 530(a6),ntscmode ;50/60 hertz halen
ifd ntsctest
move.b #60,ntscmode ;60 hertz (ntsc)
endc
cmp.b #50,ntscmode ;ntsc ?
beq.s str.ntsc
move.l #vew_hgt-56,hogscr ;set NTSC screen hight
str.ntsc
lea cprjmp,a2 ;copjmp zetten !
move.l #cprbck-8,d0
move.w d0,6(a2)
swap d0
move.w d0,2(a2)
lea cprbck-8,a2 ;copstr zetten !
move.l #cpr,d0
move.w d0,6(a2)
swap d0
move.w d0,2(a2)
bsr cprsprrem ;sprites legen
lea gfxnam,a1 ;graphics lib openen
move.l (4).w,a6
jsr -408(a6) ;openlib
move.l d0,a6
move.l d0,gfxlib
move.l 38(a6),oldcprlist
bset #1,$bfe001
bsr copbuf ;copper vullen
bsr sysoff
gadrun
btst #6,($bfe001).l
bne gadrun
scrend
scrend.play
bsr syson
move.l gfxlib,a1
move.l (4).w,a6
jsr -414(a6) ;closelib
scrend.qb
moveq.l #0,d0
rts
;vertical blank interrupt, no blits.
;handles counters,interlace,sprite
;level 3
intvb
bra.s intvb.cnt
dc.l 'VIDU'
dc.l 'LOOP'
intvb.cnt
movem.l d0-d7/a0-a6,-(sp)
lea ($dff000).l,a6
move.w $01e(a6),d0
btst #5,d0 ;vblank ?
bne.s intvb.vb
bra.s intcop.end
intvb.vb
bsr grap
bsr palctr ;palette zetten
bsr.s copbuf ;copper vullen
intvb.end
move.w #$0020,$09c(a6) ;vb bit wissen
movem.l (sp)+,d0-d7/a0-a6 ;multitask uit, shit !
rte
intcop.end
movem.l (sp)+,d0-d7/a0-a6
move.l intvbold,-(sp)
rts
;transmission buffer empty routine, BLIT !
;handles routines,animations
inttbe ;tbe interrupt
movem.l d0-d7/a0-a6,-(sp)
lea ($dff000).l,a6
move.w $01e(a6),d0
btst #0,d0 ;no tbe ?
beq.s intdskblk
btst #6,($bfe001).l ;muis ingedrukt ?
beq.s inttbe.cop
btst #2,($dff016).l
beq.s inttbe.cop
ifd debug
move.w #$700,$dff180
endc
bsr rotply ;routineplayer BLIT !
bsr.s copbuf ;copper vullen
ifd debug
move.w #$070,$dff180
endc
inttbe.cop
inttbe.end
move.w #$0001,$09c(a6)
movem.l (sp)+,d0-d7/a0-a6
rte
intdskblk
move.w #$0001,$09c(a6) ;be sure for no tbe handling
movem.l (sp)+,d0-d7/a0-a6
move.l inttbeold,-(sp)
rts
;moves the copperbuffer to the copperlist
;sort of double buffering
copbuf
movem.l d0-d7/a0-a6,-(sp)
lea ($dff000).l,a6
copbuf.novb ;copperchange overslaan
moveq.l #0,d0
move.b $005(a6),d0
lsl.w #8,d0
moveq.l #0,d1
move.b $006(a6),d1
add.w d1,d0
cmp.w #$4,d0 ;lower limit, all stations 100%
blt copbuf.novb
cmp.b #50,ntscmode
beq.s copbuf.pal
cmp.w #$133-72-8,d0 ;ntsc grens
bge copbuf.novb
bra.s copbuf.cont
copbuf.pal
cmp.w #$133-8,d0 ;pal grens
bge copbuf.novb
copbuf.cont
lea gra.s,a0 ;buffer copieren
lea cprbuf,a1
copbuf_aga ;AGA stuff :)
move.l #(gra.ql)/4-1,d0
copbuf.a
move.w 2(a0),2(a1)
add.l #4,a0
add.l #4,a1
dbra d0,copbuf.a
copbuf.end
movem.l (sp)+,d0-d7/a0-a6
rts
;goes back to the workbench
syson
movem.l d0-d7/a0-a6,-(sp)
move.w #$0001,$dff09a ;tbeint uit
move.l intvbold,($6c).w
move.l inttbeold,($64).w
move.l 4,a6
jsr -138(a6) ;permit
move.l gfxlib,a6
jsr -462(a6) ;disownblitter
move.l wbview,a1
move.l gfxlib,a6
jsr _LVOLoadView(a6) ; Fix view
jsr _LVOWaitTOF(a6)
jsr _LVOWaitTOF(a6) ; wait for LoadView()
syson.ras
cmp.b #$c0,$dff006 ;prevent copperjump
bne syson.ras
move.l gfxlib,a6
move.l gb_copinit(a6),$dff080 ; Kick it into life
movem.l (sp)+,d0-d7/a0-a6
rts
;goes back to the gadgetscreen
sysoff
movem.l d0-d7/a0-a6,-(sp)
move.l gfxlib,a6
move.l gb_ActiView(a6),wbview ;current view
sub.l a1,a1 ; clear a1
jsr _LVOLoadView(a6) ; Flush View to nothing
jsr _LVOWaitTOF(a6) ; Wait once
jsr _LVOWaitTOF(a6) ; Wait again.
move.l gfxlib,a6
jsr -456(a6) ;ownblitter
move.l 4,a6
jsr -132(a6) ;forbid
move.l ($6c).w,intvbold
move.l #intvb,($6c).w
move.l ($64).w,inttbeold
move.l #inttbe,($64).w
move.w #$8001,$dff09a ;tbeint aan
bsr gracpr ;reset copper
bsr copbuf ;copy copper
move.l #cpr,$dff080
movem.l (sp)+,d0-d7/a0-a6
rts
cprsprrem
movem.l d0-d7/a0-a6,-(sp)
lea cprspr,a0
move.l #sprdat,d0
move.w #7,d1
cprsprrem.a
move.w d0,3*2(a0)
swap d0
move.w d0,1*2(a0)
swap d0
add.l #8,a0
dbra d1,cprsprrem.a
movem.l (sp)+,d0-d7/a0-a6
rts
varset ;variablen neerzetten
movem.l d0-d7/a0-a6,-(sp)
move.l #var,a0
move.l #cprbck,var_cprbck(a0)
move.l gfxlib,var__GfxBase(a0)
move.b ntscmode,var_ntsc(a0)
move.l curpic1,var_pic1(a0) ;variabel
move.l curpic2,var_pic2(a0) ;variabel
move.w anispd1,var_anispd1(a0)
move.w anitel1,var